#include<iostream>
#include<cstdlib>
#include<cstring>
#include<vector>

using namespace std;

int insertion ( std::vector<double> &_a);

int main ( int argc, char *argv[])
{
  int n;
  cin >> n;
  vector<double> a(n);
  for(vector<double>::iterator a_iterator = a.begin();
      a_iterator != a.end();
      a_iterator++)
      cin >> *a_iterator;
  insertion(a);
  cout << n <<endl;
  for(vector<double>::iterator a_iterator = a.begin();
      a_iterator != a.end();
      a_iterator++)
      cout << *a_iterator << " ";
  cout << endl;
  return 0;
}

int insertion ( std::vector<double> &_a){
    for( int j = 1; j < _a.size(); j++)
    {
	double key = _a[j];
	int i = j-1;
	while (i >= 0 &_a[i] < key){
	    _a[i+1] = _a[i];
	    i--;
	}
	_a[i+1] = key;
    }
    return 0;

};
